const path = require("path");
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const webpack = require('webpack');

module.exports = {
	entry    : "./app.js",
	output   : {
		filename  : "app.js",
		path      : path.resolve(__dirname, "dist"),
		publicPath: "/"
	},
	devtool  : "inline-source-map",
	mode     : "development",
	plugins  : [

		new HtmlWebpackPlugin({
			title: "兰途DEMO"
		}),
		new webpack.HotModuleReplacementPlugin()
	],

	devServer: {
		contentBase: "./dist",//本地服务器所加载的页面所在的目录
		hot        : true
	},
	module   : {
		rules: [
			{
				test: /\.css$/, use: ['style-loader', 'css-loader']
			}
		]
	}
};
